package com.jgzx.constant;

import cn.hutool.core.util.ObjectUtil;

/**
 * @Description
 * @Author chenzy
 * @Date 2021/10/29 9:42
 **/
public enum MaterielAttributeEnum {

    MATERIEL_NAME("materiel_name", "物料名称"),
    SPECS_NAME("specs_name", "规格"),
    MODE_NAME("mode_name", "型号"),
    BRAND_NAME("brand_name", "品牌"),
    MATERIEL_DESC("materiel_desc", "物料描述"),
    CATEGORY_NAME("category_name", "物料分类"),
    ;

    private final String value;
    private final String showName;

    /**
     * @param value 值
     * @param showName 显示名称
     */
    MaterielAttributeEnum(String value, String showName) {
        this.value = value;
        this.showName = showName;
    }

    public static MaterielAttributeEnum getMaterielAttributeByValue(String value){
        for (MaterielAttributeEnum materielAttributeEnum : MaterielAttributeEnum.values()) {
            if (ObjectUtil.equal(value, materielAttributeEnum.value())) {
                return materielAttributeEnum;
            }
        }
        return null;
    }

    public String value() {
        return this.value;
    }

    public String showName() {
        return this.showName;
    }
}
